Answer:

It is more efficient to increase capacity by a large amount a few times rather than to increase capacity by one every time a new element is added.

List<E> Interface

Lists of things are common in the real world and in programming. People make lists of things they need to buy and lists of things they need to do. An examination often consists of a list of questions. A text editor program might keep lines of text in a list.

ArrayList implements the List<E> interface. The List<E> interface captures the idea of a list without saying how the idea is implemented. ArrayList is just one implementation of the idea. Recall that an interface consists of constants and method declarations. A class that implements an interface must implement each of the methods listed in the interface. There are no constants in List<E> , but there are many methods.

A list is an ordered collection of elements. Duplicate elements are allowed in an ArrayList (and in most other implementations of list). Items in a list can be accessed by their index, as with an array. There are methods to add elements, get elements, remove elements, and search for elements (and many other methods).

QUESTION 9:

What number do the indexes for a list start at?